import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;


public class FileWriterAndReaderDemo {

	String s1 = "C:\\Users\\Dev-1\\workspace\\Day25text1.txt";
	
	public static void main(String[] args) {
		
		FileWriter fw = null;
		Reader reader = null;
		try{
//			fw = new FileWriter(new File("C:\\Users\\Dev-1\\workspace\\Day26_Reader_Writer\\text1.txt"),true);
//			fw.write("fhkfjlkfjlwfj");
			
			reader = new FileReader("C:\\Users\\Dev-1\\workspace\\Day26_Reader_Writer\\text1.txt");
			char[]c = new char[20]; // 6te 4ete kolkoto e folqm masiva, a pri string ne znae kolko da chete
			reader.read(c);
			System.out.println(new String(c));
			
		}catch (IOException e) {
			e.printStackTrace();
		}
		finally {
			try {
				reader.close();
			}catch (IOException e) {
				e.printStackTrace();
			}
			
		}
		
	}

}
